package adv4;

import java.util.Calendar;

/**
 * @author oldliu
 * @since 1.0
 */
public class Cal {
    public static void main(String[] args) {
        Calendar c=Calendar.getInstance();
        System.out.println(c);
        System.out.println("互联网纪年开始："+c.getTimeInMillis());
        System.out.println("日期:"+c.getTime());
        System.out.println("get/////////////////");
        int year = c.get(Calendar.YEAR);
        int month=c.get(Calendar.MONTH);
        int day=c.get(Calendar.DAY_OF_MONTH);
        System.out.println(year+","+month+","+day);

        System.out.println(">>>>>>>>>>>>>>");
        c.add(Calendar.DATE,-20);
        System.out.println("现在是："+c.getTime());
        System.out.println(">>>>>>>>>>>>>>>>");
        c.roll(Calendar.MINUTE,-100);
        System.out.println("现在是："+c.getTime());
        //最大值
        int days = c.getActualMaximum(Calendar.DAY_OF_YEAR);
        System.out.println(days+"这一年的天数：");
        //
        int d = c.get(Calendar.DAY_OF_YEAR);
        System.out.println("今天是本年的第"+d+"天");

    }
}
